Error diffusion techniques are used in various prior art graphical image acceleration schemes to aid in the conversion of a digitally-generated image from one pixel resolution (“pixel depth”) to another. Graphic images, whether generated for printer applications or for two dimensional (“2D”) or three dimensional (“3D”) computer-based graphics rendering applications are typically represented by values known as “pixels”. Pixels may have an associated color and/or texture value, represented by a combination of component colors and/or textures. For example, in printer applications, pixels may be represented by four component color values, cyan, magenta, yellow, and black, (CMYK) which contribute to the overall color value of a pixel. In some prior art printer applications, CMYK color components may be represented by bit words comprising up to 8 bits per component, creating a 32 bit representation of the pixel (8 bits multiplied by 4 components).
Similarly, in computer-based graphics rendering applications, a pixel may be represented by three or more components, including red, green, and blue (RGB). In other applications, a pixel may be represented by values that aren't directly representative of colors, but of other properties of the pixel, such as the pixel's texture. In computer-based 2D/3D graphics applications, each component, RGB, may be represented by a number of bits, such as 8, which contribute to a pixel value having 24 bits (8 bits multiplied by 3 components).
It may be desirable to reduce the number of bits necessary to represent a pixel by converting it to a different component representation, which in turn reduces the pixel depth. This may be true for applications that do not need a certain color representation of an image, but may rather display an image adequately using fewer colors or merely shades of gray (e.g., “gray scale”). Color pixels may be converted by converting the individual components that make up the pixel. In this case, each component of the representation of a pixel may be converted from an original amplitude resolution to a different amplitude resolution. For example, by converting each 8 bit component to 1 bit makes the CMYK 32 bit color pixel which comprises of 4 components of 8 bits each into a 4 bit color pixel comprising of 1 bit each. Similarly in the case of grayscale, a pixel may be converted from a 8 bit pixel that may have any one of 256 values (ranging from 0 to 255) to a pixel that is represented by 1 bit that is either “on” or “off” (82-1 color/component).
As with any process that reduces the resolution of representation, there is a resultant “error” that is a result of the reduced resolution. This “error” may be dispersed or “diffused” across other pixels in an image in order to create a more smooth transition between the new colors of the pixels resulting from the conversion in pixel component color depth. For example, the error that results from a conversion from 8 bits per pixel component (i.e. 256 values/component) to a 1 bit per pixel component (i.e. on/off) could be distributed to a certain pre-defined number of immediate neighbors.
In order to convert pixels from a higher amplitude resolution to a lower resolution, the original pixel may need to be compared to a “threshold” value to determine whether the pixel component is to be turned on or off. In other techniques, more than one threshold may have to be used, if say for example, the lower amplitude resolution is greater than 2 bits or more.
The difference between the original pixel component value (8 bit value, in the above example) and the threshold may define the error in the pixel component conversion. In order to improve the visual quality in the transition among pixels that have been converted to a lower pixel component resolution, the error may be distributed among neighboring (e.g., adjacent) pixels such that the state of the neighboring pixels are effected by the error a neighboring converted pixel. Such an error distribution may contribute to a neighboring being turned “on” (in the previous example) instead of “off”, as the error contributes to a value of the pixel that pushes it over the threshold between “on” and “off”. Conversely, the error may detract from the converted pixel value such that the pixel is turned “off” instead of “on”.
One prior art technique for distributing the error among neighboring pixels involves a proprietary algorithm implemented by a third party graphics vendor, for example, that may be performed in proprietary hardware or software. Proprietary algorithms may determine the threshold value and perform the threshold comparison (“thresholding”) in order to allow a user to have control over this aspect of the pixel color component depth conversion process in addition to other functions associated with the conversion, such as the error generation and distribution. One problem with this prior art solution is that proprietary hardware that performs all of these functions can often increase computer system cost, while proprietary software performing these functions is sometimes not optimized to run on a particular processor. Therefore, the system cost and performance may suffer as a result. Furthermore, various functions, such as error generation and distribution may not be functions that change among various proprietary solutions, therefore these functions may consume unnecessary proprietary hardware or software resources and possibly inhibit error distribution performance without adding significant value to the proprietary solution.